<?php

require_once("retreivePlanholderInfoController.php");
//require_once("editPlanholderController.php");
//private $edit;
$ret = new retreivePlanholderInfoController;

	session_start();
	if(!isset($_SESSION['user'])||$_SESSION['pos']!="Regular")
	{
		header("Location: index.php");
	}
	require_once("function.php");
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>APO Cooperative Database System - Home</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="css/ui-lightness/jquery-ui-1.8rc2.custom.css" />

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8rc2.custom.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
	$(".datepicker").datepicker({ changeYear: true, dateFormat: 'yy-mm-dd' });
	
});
</script>
</head>
<body>
<div class="container ui-corner-all">
	<div class="header ui-corner-top">
  <h1>APO Cooperative Database System</h1>
</div>
<div class="divider"></div>
  <div class="wrapper">
    <div class="content">
	<table>
	
	<?php

	$result = $ret -> sendEditPlanholderRequest($_REQUEST['Policy_no']);	


	

	$row = mysql_fetch_array($result);
	
	echo 
	"<form action=\"editPlanholderController.php\" method=\"post\">
		<tr>
		<td><input type=\"hidden\"  name=\"policyNumber\" value=\"".$row['Policy_no']."\" /></td>
		</tr>
		<tr>
		<td>First Name:</td><td><input type=\"text\" name=\"firstName\" value=\"".$row['First_name']."\" /></td>
		</tr>
		<tr>
		<td>Last Name:</td><td><input type=\"text\" name=\"lastName\" value=\"".$row['Last_name']."\" /></td>
		</tr>
		<tr>
		<td>Middle Initial:</td><td><input type=\"text\" name=\"middle\" value=\"".$row['Middle_name']."\" /></td>
		</tr>
		<tr>
		<td>Type of Plan:</td><td><select name=\"type\">

							<option value=\"Harmonious\">Harmonious</option>
							<option value=\"Glorious\">Glorious</option>
							<option value=\"Fraternal\">Fraternal</option>
							<option value=\"Equitable\">Equitable</option>
							<option value=\"Divinity\">Divinity</option>
							<option value=\"Celebrity\">Celebrity</option>
							<option value=\"Bossom\">Bossom</option>
							<option value=\"Supreme\">Supreme</option>
						</select>
			</td>
			</tr>
			<tr>
			<td>Mode of Payment:</td><td><select name=\"mode\">
								<option value=\"Monthly\">Monthly</option>
								<option value=\"Quarterly\">Quarterly</option>
								<option value=\"Semi-annually\">Semi-annually</option>
								<option value=\"Annually\">Annually</option>
							</select>
			</td>
			</tr>

		<tr>
		<td>Birthday:</td><td><input type=\"text\" name=\"birthday\"  class=\"datepicker\" readonly=\"readonly\" value=\"".$row['Bday']."\" /></td>
		</tr>
		<tr>
		<td>Application Number:</td><td><input type=\"text\" name=\"applicationNo\" value=\"".$row['Application_no']."\" /></td>
		</tr>
		<tr>
		<td>Term:</td><td><input type=\"text\" name=\"term\" value=\"".$row['Term']."\" /></td>
		</tr>
		<tr>
		<td>Plan Value:</td><td><input type=\"text\" name=\"planValue\" value=\"".$row['Plan_value']."\" /></td>
		</tr>
		<tr>
		<td>Effective Date:</td><td><input type=\"text\" name=\"effectiveDate\"  class=\"datepicker\" readonly=\"readonly\" value=\"".$row['Effective_date']."\" /></td>
		</tr>
		<tr>
		<td>Due Date:</td><td><input type=\"text\" name=\"dueDate\"  class=\"datepicker\" readonly=\"readonly\" value=\"".$row['Due_date']."\" /></td>
		</tr>
		<tr>
		<td>Branch:</td><td><input type=\"text\" name=\"branch\" value=\"".$row['Branch']."\" /></td>
		</tr>
		<tr>
		<td></td>
		<td><input type=\"submit\" value=\"Save Changes\" /></td>
		</tr>
	</form>";

	?>
	</table>
	  </div></div>
  <div class="navigation ui-corner-all">
    <div class="navheader ui-corner-top"></div>
  	<div class="userstat">
    <?php
    	
			echo "<p>You are logged in as: <br/>".$_SESSION['name']."<br/></p>";
			echo "<a href=\"\">Edit</a> your profile<br />";
			echo "<a href=\"logOut.php\">Log Out</a><br />";
		
	?>
    </div>
    </div>
    <div class="extra ui-corner-all">
    <div class="navheader ui-corner-top"></div>
    <div class="userstat">
    	<a href="employeepage.php">Back to profile page</a><br />
    	<a href="addPlanholderView.php">Add Planholders</a><br />
        <a href="viewStartedContractsView.php">View Started Contract</a><br />
    </div>
    </div>
    <div class="footer ui-corner-bottom">
    <a href="#">Contact Us</a> | <a href="#">Terms of Use</a> | <a href="#">Trademarks</a> | <a href="#">Privacy Statement</a><br />
    Copyright &copy; 2009 . All Rights Reserved.
  </div>
</div>
	</body>
</html>